package com.logback.basic;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author chenfoxin
 * @Description 统一返回体
 * @Date 2022/6/8 7:30
 **/
@Setter
@Getter
@NoArgsConstructor
public class ResponseData<T>{
    private int code;
    private String msg;
    private T data;
    private String traceId;

    public ResponseData setData(T data) {
        this.data = data;
        return this;
    }

    public void ok() {
        this.code = 0;
        this.msg = "ok";
    }
}
